package com.dhcc.DRGsHosp.facade.impl.assembler;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import com.dhcc.DRGsHosp.core.domain.CostSub;
import com.dhcc.DRGsHosp.facade.dto.CostSubDTO;

	
public class CostSubAssembler {
	public static CostSubDTO  toDTO(CostSub  costSub){
		if (costSub == null) {
			return null;
		}
    	CostSubDTO result  = new CostSubDTO();
	    result.setCostSubcode (costSub.getCostSubcode());
    	result.setParcostCatecode (costSub.getParcostCatecode());
    	result.setCostSubdesc (costSub.getCostSubdesc());
    	result.setDccCode (costSub.getDccCode());
    	result.setOrderScode(costSub.getOrderScode());
    	result.setCostSubAlias(costSub.getCostSubAlias());
    	result.setIsDetail(costSub.getIsDetail());
    	result.setCostCodeQuality(costSub.getCostCodeQuality());
     	return result;
	 }
	
	public static List<CostSubDTO>  toDTOs(Collection<CostSub>  costSubs){
		if (costSubs == null) {
			return null;
		}
		List<CostSubDTO> results = new ArrayList<CostSubDTO>();
		for (CostSub each : costSubs) {
			results.add(toDTO(each));
		}
		return results;
	}
	
	 public static CostSub  toEntity(CostSubDTO  costSubDTO){
	 	if (costSubDTO == null) {
			return null;
		}
	 	CostSub result  = new CostSub();
         result.setCostSubcode (costSubDTO.getCostSubcode());
         result.setParcostCatecode (costSubDTO.getParcostCatecode());
         result.setCostSubdesc (costSubDTO.getCostSubdesc());
         result.setDccCode (costSubDTO.getDccCode());
         result.setOrderScode(costSubDTO.getOrderScode());
     	 result.setCostSubAlias(costSubDTO.getCostSubAlias());
     	 result.setIsDetail(costSubDTO.getIsDetail());
     	 result.setCostCodeQuality(costSubDTO.getCostCodeQuality());
 	  	return result;
	 }
	
	public static List<CostSub> toEntities(Collection<CostSubDTO> costSubDTOs) {
		if (costSubDTOs == null) {
			return null;
		}
		
		List<CostSub> results = new ArrayList<CostSub>();
		for (CostSubDTO each : costSubDTOs) {
			results.add(toEntity(each));
		}
		return results;
	}
}
